#pragma once
#include "Singleton.h"

struct PointInfo
{
	uint point_id;
	float2 last_position;

	PointInfo()
	{
		point_id = 0;
	}
};

enum PointPressStatus
{
	PointStatus_None,
	PointStatus_One,
	PointStatus_Two,
	PointStatus_Three,
};

ref class InputManager: public SingletonRef<InputManager>
{
	friend SingletonRef;
internal:
	InputManager();

	void Initialize(
		_In_ Windows::UI::Core::CoreWindow^ window
        );

	uint GetPressedPointVecSize();

	PointInfo& GetPressedPointAt(uint index);

	PointPressStatus GetPointPressStatus();

protected:
	void OnPointerPressed(
		_In_ Windows::UI::Core::CoreWindow^ sender,
		_In_ Windows::UI::Core::PointerEventArgs^ args
		);
    void OnPointerMoved(
        _In_ Windows::UI::Core::CoreWindow^ sender,
        _In_ Windows::UI::Core::PointerEventArgs^ args
        );
    void OnPointerReleased(
        _In_ Windows::UI::Core::CoreWindow^ sender,
        _In_ Windows::UI::Core::PointerEventArgs^ args
        );
    void OnPointerExited(
        _In_ Windows::UI::Core::CoreWindow^ sender,
        _In_ Windows::UI::Core::PointerEventArgs^ args
        );
    void OnKeyDown(
        _In_ Windows::UI::Core::CoreWindow^ sender,
        _In_ Windows::UI::Core::KeyEventArgs^ args
        );
    void OnKeyUp(
        _In_ Windows::UI::Core::CoreWindow^ sender,
        _In_ Windows::UI::Core::KeyEventArgs^ args
        );

    void OnMouseMoved(
        _In_ Windows::Devices::Input::MouseDevice^ mouseDevice,
        _In_ Windows::Devices::Input::MouseEventArgs^ args
        );

	void OnPointerWheel(
		_In_ Windows::UI::Core::CoreWindow^ sender,
		_In_ Windows::UI::Core::PointerEventArgs^ args
		); 
private:
    void     ResetState();

	void	 UpdatePointStaus(Windows::UI::Core::PointerEventArgs^ args);

	std::vector<PointInfo> m_PressedPointVec;

	PointPressStatus	   m_PointPressStatus;
	
	
};